package com.hs.mapper;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.hs.entity.dto.Comment;
import com.hs.entity.dto.TeamType;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface TeamTypeMapper extends BaseMapper<TeamType> {

    @Select("<script>" +
            "SELECT DISTINCT tt.*, t.team_name " +
            "FROM team_types tt " +
            "LEFT JOIN teams t ON tt.team_id = t.id " +
            "<where>" +
            "<if test='ew != null'>${ew.sqlSegment}</if>" +
            "</where>" +
            "</script>" )
    List<TeamType> selectListWithTeamName(@Param("ew") Wrapper<TeamType> queryWrapper);


}
